import json
def load_Registerdata(filepath):
    testdata=[]
    with open(filepath,encoding='utf-8') as f:
        file_data=json.load(f)
        for data in file_data:
            testCase=data.get("testCase")
            username=data.get("username")
            password=data.get("password")
            confirm_password=data.get("confirm_password")
            phone=data.get("phone")
            status_code=data.get("status_code")
            msg=data.get("msg")
            email=data.get("email")
            doctor_id=data.get("doctor_id")
            testdata.append((testCase,username,password,confirm_password,phone,status_code,msg,email,doctor_id))
    return testdata
def load_Logindata(filepath):
    testdata=[]
    with open(filepath,encoding='utf-8') as f:
        load_data=json.load(f)
    for data in load_data:
        testCase=data.get("testCase")
        username=data.get("username")
        password=data.get("password")
        msg=data.get("msg")
        status_code=data.get("status_code")
        testdata.append((testCase,username,password,msg,status_code))
    return testdata
def load_deviceAdddata(filepath):
    testdata=[]
    with open(filepath,encoding='utf-8') as f:
        load_data=json.load(f)
    for data in load_data:
        testCase=data.get("testCase")
        device_id=data.get("device_id")
        name=data.get("name")
        msg=data.get("msg")
        status_code=data.get("status_code")
        testdata.append((testCase,device_id,name,msg,status_code))
    return testdata
def load_ecgUploaddata(filepath):
    testdata=[]
    with open(filepath,encoding='utf-8') as f:
        load_data=json.load(f)
    for ecg_data in load_data:
        testCase=ecg_data.get("testCase")
        device_id=ecg_data.get("device_id")
        data=ecg_data.get("data")
        msg=ecg_data.get("msg")
        status_code=ecg_data.get("status_code")
        timestamps=ecg_data.get("timestamps")
        testdata.append((testCase,device_id,data,msg,status_code,timestamps))
    return testdata
